using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using MimeCloud.WindowsForms.Presentation.Controls;
using MimeCloud.AssetManagement.Business.Interface;

namespace MimeCloud.AssetManagement.AssetRendering.Metadata
{
    /// <summary>
    /// Interaction logic for MetadataValueEditorDialog.xaml
    /// </summary>
    public partial class MetadataValueEditorDialog : Window
    {
        public MetadataValueEditorDialog()
        {
            InitializeComponent();
        }

        public IMetaData MetadataValue { get; set; }
        public string AlteredValue = String.Empty;

        private void btSave_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
            AlteredValue = MimeCloud.Business.Helpers.Text.StripHtml(formsEditor.Text);
        }

        private HtmlEditor formsEditor = null;

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //add html editor
            formsEditor = new HtmlEditor();
            windowsFormsHost1.Child = formsEditor;
            formsEditor.Text = MetadataValue.MetaValue.Value;
        }

        private void btCancel_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
            this.Close();
        }

    }
}
